#include "widget.h"
#include "ui_widget.h"
#include "guass.h"
#include "doolittle.h"

Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_PB_cal_clicked()
{

    if(ui->RB_Guass->isChecked()){
     //   QMessageBox::information(this,"Title",QString("Guass")+QString(""));
        Guass *valGuass = new Guass(ui->PTE_input->toPlainText(),ui->SB_len->text().toInt());
        valGuass->Run();
        ui->PTE_output->clear();
        ui->PTE_output->appendPlainText(valGuass->getAns());

    }else{
    //    QMessageBox::information(this,"Title",QString("Doolittle")+QString(""));
        Doolittle *valDoolittle = new Doolittle(ui->PTE_input->toPlainText(),ui->SB_len->text().toInt());
        valDoolittle->Run();
        ui->PTE_output->clear();
        ui->PTE_output->appendPlainText(valDoolittle->getAns());
    }
}
